package com.example.orderservice.service.impl;

import com.example.communservice.entity.Order;
import com.example.orderservice.feign.UserFeign;
import com.example.orderservice.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
    @Qualifier("com.example.orderservice.feign.UserFeign")
    @Autowired
    private UserFeign userFeign;
    @Override
    public Order getUserOrder(Integer userId) {
        System.out.println("开始服务间调用");
        return new Order(userFeign.getUserById(userId),1);
    }
}
